﻿<UserControl xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"  x:Class="CarbonKit.Demo.Silverlight3.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:CarbonKit.Demo.Silverlight3" xmlns:core="clr-namespace:CarbonKit.Core.Silverlight3;assembly=CarbonKit.Core.Silverlight3" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
        <local:AllotropeEnumeration x:Key="AllotropeEnumerationDataSource" d:IsDataSource="True"/>
        <core:EnumValueConverter x:Key="EnumConverter" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <dataInput:Label Grid.Column="0" Grid.Row="0" Content="Enum to list:"/>
        <ListBox Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" x:Name="enumList" ItemsSource="{Binding Source={StaticResource AllotropeEnumerationDataSource}, Converter={StaticResource EnumConverter}}" DisplayMemberPath="Value" Tag="Key" />
        <dataInput:Label Grid.Column="1" Grid.Row="0" Content="Selected enum value:"/>
        <dataInput:Label Grid.Column="1" Grid.Row="1" Content="{Binding ElementName=enumList, Path=SelectedValue}"/>

    </Grid>
</UserControl>
